treeview: always pixelcache widget contents
authorChristian Hergert <christian@hergert.me>
Tue, 16 Jun 2015 23:50:44 +0000 (16:50 -0700)
committerChristian Hergert <christian@hergert.me>
Wed, 17 Jun 2015 01:08:22 +0000 (18:08 -0700)
GtkTreeView has a particularly expensive drawing path. This can cause
issues when part of animated widget sequences. Caching the content while
a model is attached helps reduce the number of full redraws during
exposure greatly.

https://bugzilla.gnome.org/show_bug.cgi?id=751082

gtk/gtktreeview.c

index 1e4779f984106b2f1cf248671c3e158882cdb868..5eaed63e53912d23fc2d9d0fd2fd3c117001fb51 100644 (file)
@@ -11540,6 +11540,8 @@ gtk_tree_view_set_model (GtkTreeView  *tree_view,
   if (tree_view->priv->selection)
   _gtk_tree_selection_emit_changed (tree_view->priv->selection);
 
+  _gtk_pixel_cache_set_always_cache (tree_view->priv->pixel_cache, (model != NULL));
+
   if (gtk_widget_get_realized (GTK_WIDGET (tree_view)))
     gtk_widget_queue_resize (GTK_WIDGET (tree_view));
 }